<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>6.2jQuery基础-常用选择器</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
  <div id="one">id选择器</div>
  <h3>元素选择器</h3>
  <h3>元素选择器</h3>
  <div class="a">类选择器</div>
  <div class="a">类选择器</div>
  <script>
    // 当文档加载完成后执行
    $(document).ready(function(){
      // id选择器
      console.log($("#one"))
      // 元素选择器
      console.log($("h3"))
      // 类选择器
      console.log($(".a"))
      // 遍历数组
      $.each([2,3,4],function(index,item){
        console.log(index,item)
      })
      $.each($(".a"),function(index,item){
        console.log(index,item)
      })
    })
  </script>

</body>
</html>